package com.easyperl;

import org.eclipse.swt.widgets.Dialog;


import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.Text;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Group;

public class VariableConfigDialog extends Dialog {

	protected Object result;
	protected Shell shlVariableConfiguration;
	private Table table;
	private Text text;
	private Text text_1;

	/**
	 * Create the dialog.
	 * @param parent
	 * @param style
	 */
	public VariableConfigDialog(Shell parent, int style) {
		super(parent, style);
		setText("SWT Dialog");
	}

	/**
	 * Open the dialog.
	 * @return the result
	 */
	public Object open() {
		createContents();
		shlVariableConfiguration.open();
		shlVariableConfiguration.layout();
		Display display = getParent().getDisplay();
		while (!shlVariableConfiguration.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
		return result;
	}

	/**
	 * Create contents of the dialog.
	 */
	private void createContents() {
		shlVariableConfiguration = new Shell(getParent(), getStyle());
		shlVariableConfiguration.setSize(313, 225);
		shlVariableConfiguration.setText("Variable Configuration");
		
		table = new Table(shlVariableConfiguration, SWT.BORDER | SWT.FULL_SELECTION);
		table.setBounds(10, 111, 275, 64);
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
		
		Group group = new Group(shlVariableConfiguration, SWT.NONE);
		group.setBounds(10, 10, 275, 85);
		
		text = new Text(group, SWT.BORDER);
		text.setBounds(107, 31, 152, 18);
		
		Label label = new Label(group, SWT.NONE);
		label.setText("Variable value");
		label.setBounds(10, 34, 92, 12);
		
		Label label_1 = new Label(group, SWT.NONE);
		label_1.setText("Variable Name");
		label_1.setBounds(10, 13, 78, 12);
		
		text_1 = new Text(group, SWT.BORDER);
		text_1.setBounds(107, 10, 152, 18);
		
		Button button = new Button(group, SWT.NONE);
		button.setText("Add");
		button.setBounds(187, 53, 72, 22);

	}
}
